﻿using System;
using System.Windows;
using System.Windows.Controls.Primitives;

namespace RecordBill.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded+= W_Loaded;
        }

        private void W_Loaded(object sender, RoutedEventArgs e)
        {
            HomeBtn.IsChecked = true;
        }

        private void NavContainer_Click(object sender, RoutedEventArgs e)
        {

            if (e.Source is ToggleButton btn)
            {
                var children = NavContainer.Children;

                foreach (var item in children)
                {
                    if (item is ToggleButton btn1)
                    {
                        btn1.IsChecked = false;
                    }
                }
                btn.IsChecked = true;
            }
        }
    }
}
